<?php

/**
 * Created by PhpStorm.
 * User: evan
 * Date: 16/8/23
 * Time: 下午2:27
 */
class Profile extends MY_Api_Controller
{
    /**
     * 用户个人资料
     *
     * Profile constructor.
     */
    public function profiles()
    {
        $uid         = $this->uid;
        $is_complete = (int)$this->input->get_post('is_complete');
        
        $uid = $this->uid ? $this->uid : $uid;

        $this->load->service('user/service_user_profile');
        $data = $this->service_user_profile->my($uid, $is_complete);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 查看他人用户信息
     */
    public function who_profile()
    {
        $uid         = $this->uid;
        $get_uid     = (int)$this->input->get_post('get_uid');
        $ds_id       = (int)$this->input->get_post('ds_id');

        $this->load->service('user/service_user_profile');
        $data = $this->service_user_profile->who($uid, $get_uid, $ds_id);

        $this->json_output($data['data'], $data['status']);
    }
}